-
Notifications
You must be signed in to change notification settings - Fork 4.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix(tracing): set attribute http.status_code
when no route entry matched
#11711
Conversation
991f339
to
2ebe243
Compare
kong/runloop/handler.lua
Outdated
@@ -1145,6 +1145,7 @@ return { | |||
if not match_t then | |||
-- tracing | |||
if span then | |||
span:set_attribute("http.status_code", 404) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ahh, Yeah, thanks! Being an attribute of root span is much more reasonable, and it seem optional to be added to router span, and I'd like just add it to root span.
same purpose of recording the status as #11406 , but it can't cover the issue in this case.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@liverpool8056 unless I'm missing something, I think #11406 solves this problem too. I just ran your test without this fix and it's passing.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I just verified the effectiveness of #11406 too. And it reminds that kong.response.exit() doesn't interrupt the current request, and the remaining phases are still gonna to be executed, so it's better to mark the attribute of root span at later phase as possible as we can.
Let me close this one.
2d7ec16
to
3678fec
Compare
…` span when no routing entry is matched. FTI-5407
3678fec
to
c1d6ca9
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
looks to be already resolved by #11406
Summary
set attribute
http.status_code
in span when no route entry matchedChecklist
changelog/unreleased/kong
orskip-changelog
label added on PR if changelog is unnecessary. README.mdFull changelog
Issue reference
FTI-5407